
<div class="admin-main-container">

    <script type="text/javascript" src="/Public/static/uploadify/jquery.uploadify.min.js"></script>

    <div class="with-padding">
        <form action="{:addons_url('Adfloat://Adfloat/index')}" class="form-horizontal" method="post">
            <div class="form-item cf">
                <label class="item-label">
                    是否开启首页图片漂浮:            </label>
                <div class="controls">
                    <select name="status">
                        <option value="1"  <?php if($_list[0]['status'] == 1) echo 'selected="selected"'; ?> >开启</option><option value="0" <?php if($_list[0]['status'] == 0) echo 'selected="selected"'; ?> >关闭</option>            </select>
                </div>
            </div><div class="form-item cf">
            <label class="item-label">
                输入你的描述            </label>
            <div class="controls">
                <input type="text" name="desc" class="form-control text form-input-width" value="<?php echo $_list[0]['desc'];?>">
            </div>
        </div><div class="form-item cf">
            <label class="item-label">
                输入图片高度(单位：px)            </label>
            <div class="controls">
                <input type="text" name="height" class="form-control text form-input-width" value="<?php echo $_list[0]['height'];?>">
            </div>
        </div><div class="form-item cf">
            <label class="item-label">
                输入图片宽度(单位：px)            </label>
            <div class="controls">
                <input type="text" name="width" class="form-control text form-input-width" value="<?php echo $_list[0]['width'];?>">
            </div>
        </div><div class="form-item cf">
            <label class="item-label">
                输入跳转的地址(外部地址必须加入http等协议)            </label>
            <div class="controls">
                <input type="text" name="url" class="form-control text form-input-width" value="<?php echo $_list[0]['url'];?>">
            </div>
        </div>
            <div style="margin-top: 10px">
                <div class="form-item cf " style="display: block" id="img_area">
                    <label class="item-label">漂浮图片</label>
                    <div class="controls">
                        {:W('Common/UploadImage/render',array(array('name'=>'img','id'=>'cover_id','value'=>$_list[0]['img'])))}
                        <!--<input type="file" id="upload_picture">
                        <input type="hidden" id="cover_id" name="cover_id" value="{$info.cover_id}"/>
                        <div class="upload-img-box">
                        <notempty name="info['cover_id']">
                            <div class="upload-pre-item"><img src="{$info.cover_id|get_cover='path'}"/></div>
                        </notempty>
                        </div>-->
                    </div>
                </div>
            </div>


                <button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>

        </form></div>


</div>
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript">

    (function(){
        var url = "{$current}";
        $("#subnav").find("a[href='" + url + "']").parent().addClass("current");

        //上传文件
        /* 初始化上传插件 */
        $("#download-file").uploadify({
            "height"          : 30,
            "swf"             : "__STATIC__/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传文件",
            "uploader"        : "{:U('File/upload',array('session_id'=>session_id()))}",
            "width"           : 120,
            'removeTimeout'   : 1,
            "onUploadSuccess" : uploadSuccess
        });

        /* 文件上传成功回调函数 */
        function uploadSuccess(file, data){
            var data = $.parseJSON(data);
            if(data.status){
                $("input[name=file]").val(data.data);
                $("input[name=file]").parent().find('.upload-img-box').html(
                    "<div class=\"uplaod-pre-file\">" + data.info + "</div>"
                );
            } else {
                updateAlert(data.info);
            }
        }


    })();
</script>